package com.dgshanger.sanhxiaofeisc.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.dgshanger.sanhxiaofeisc.R
import com.dgshanger.sanhxiaofeisc.common.Constants
import com.dgshanger.sanhxiaofeisc.entity.HomeEntity
import com.dgshanger.sanhxiaofeisc.ui.home.utils.ImageLoader

/**
 * Created by JacobHHH on 2018/5/2.
 */
class NearbyHotAdapter(layoutResId : Int, data : List<HomeEntity.CategoryListBean>) : BaseQuickAdapter<HomeEntity.CategoryListBean,BaseViewHolder>(layoutResId ,data) {

    override fun convert(helper: BaseViewHolder?, item: HomeEntity.CategoryListBean?) {
        ImageLoader.loadToUrl(mContext,helper!!.getView(R.id.iv_item_icon),Constants.getBaseUrl()+item?.img)
        helper.setText(R.id.tv_item_title,item!!.category_name)
    }
}